Optimal. Leaf size=159 \[ \frac {c^2 \left (b c^2+2 a d^2\right ) x \sqrt {-c+d x} \sqrt {c+d x}}{16 d^4}+\frac {\left (b c^2+2 a d^2\right ) x (-c+d x)^{3/2} (c+d x)^{3/2}}{8 d^4}+\frac {b x^3 (-c+d x)^{3/2} (c+d x)^{3/2}}{6 d^2}-\frac {c^4 \left (b c^2+2 a d^2\right ) \tanh ^{-1}\left (\frac {\sqrt {-c+d x}}{\sqrt {c+d x}}\right )}{8 d^5} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.08, antiderivative size = 159, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 7, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.226, Rules used = {471, 92, 12, 38,
65, 223, 212} \begin {gather*} \frac {c^2 x \sqrt {d x-c} \sqrt {c+d x} \left (2 a d^2+b c^2\right )}{16 d^4}+\frac {x (d x-c)^{3/2} (c+d x)^{3/2} \left (2 a d^2+b c^2\right )}{8 d^4}-\frac {c^4 \left (2 a d^2+b c^2\right ) \tanh ^{-1}\left (\frac {\sqrt {d x-c}}{\sqrt {c+d x}}\right )}{8 d^5}+\frac {b x^3 (d x-c)^{3/2} (c+d x)^{3/2}}{6 d^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 38
Rule 65
Rule 92
Rule 212
Rule 223
Rule 471
Rubi steps
\begin {align*} \int x^2 \sqrt {-c+d x} \sqrt {c+d x} \left (a+b x^2\right ) \, dx &=\frac {b x^3 (-c+d x)^{3/2} (c+d x)^{3/2}}{6 d^2}+\frac {1}{2} \left (2 a+\frac {b c^2}{d^2}\right ) \int x^2 \sqrt {-c+d x} \sqrt {c+d x} \, dx\\ &=\frac {\left (b c^2+2 a d^2\right ) x (-c+d x)^{3/2} (c+d x)^{3/2}}{8 d^4}+\frac {b x^3 (-c+d x)^{3/2} (c+d x)^{3/2}}{6 d^2}+\frac {\left (b c^2+2 a d^2\right ) \int c^2 \sqrt {-c+d x} \sqrt {c+d x} \, dx}{8 d^4}\\ &=\frac {\left (b c^2+2 a d^2\right ) x (-c+d x)^{3/2} (c+d x)^{3/2}}{8 d^4}+\frac {b x^3 (-c+d x)^{3/2} (c+d x)^{3/2}}{6 d^2}+\frac {\left (c^2 \left (b c^2+2 a d^2\right )\right ) \int \sqrt {-c+d x} \sqrt {c+d x} \, dx}{8 d^4}\\ &=\frac {c^2 \left (b c^2+2 a d^2\right ) x \sqrt {-c+d x} \sqrt {c+d x}}{16 d^4}+\frac {\left (b c^2+2 a d^2\right ) x (-c+d x)^{3/2} (c+d x)^{3/2}}{8 d^4}+\frac {b x^3 (-c+d x)^{3/2} (c+d x)^{3/2}}{6 d^2}-\frac {\left (c^4 \left (b c^2+2 a d^2\right )\right ) \int \frac {1}{\sqrt {-c+d x} \sqrt {c+d x}} \, dx}{16 d^4}\\ &=\frac {c^2 \left (b c^2+2 a d^2\right ) x \sqrt {-c+d x} \sqrt {c+d x}}{16 d^4}+\frac {\left (b c^2+2 a d^2\right ) x (-c+d x)^{3/2} (c+d x)^{3/2}}{8 d^4}+\frac {b x^3 (-c+d x)^{3/2} (c+d x)^{3/2}}{6 d^2}-\frac {\left (c^4 \left (b c^2+2 a d^2\right )\right ) \text {Subst}\left (\int \frac {1}{\sqrt {2 c+x^2}} \, dx,x,\sqrt {-c+d x}\right )}{8 d^5}\\ &=\frac {c^2 \left (b c^2+2 a d^2\right ) x \sqrt {-c+d x} \sqrt {c+d x}}{16 d^4}+\frac {\left (b c^2+2 a d^2\right ) x (-c+d x)^{3/2} (c+d x)^{3/2}}{8 d^4}+\frac {b x^3 (-c+d x)^{3/2} (c+d x)^{3/2}}{6 d^2}-\frac {\left (c^4 \left (b c^2+2 a d^2\right )\right ) \text {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\frac {\sqrt {-c+d x}}{\sqrt {c+d x}}\right )}{8 d^5}\\ &=\frac {c^2 \left (b c^2+2 a d^2\right ) x \sqrt {-c+d x} \sqrt {c+d x}}{16 d^4}+\frac {\left (b c^2+2 a d^2\right ) x (-c+d x)^{3/2} (c+d x)^{3/2}}{8 d^4}+\frac {b x^3 (-c+d x)^{3/2} (c+d x)^{3/2}}{6 d^2}-\frac {c^4 \left (b c^2+2 a d^2\right ) \tanh ^{-1}\left (\frac {\sqrt {-c+d x}}{\sqrt {c+d x}}\right )}{8 d^5}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.24, size = 116, normalized size = 0.73 \begin {gather*} \frac {d x \sqrt {-c+d x} \sqrt {c+d x} \left (-6 a d^2 \left (c^2-2 d^2 x^2\right )+b \left (-3 c^4-2 c^2 d^2 x^2+8 d^4 x^4\right )\right )-6 c^4 \left (b c^2+2 a d^2\right ) \tanh ^{-1}\left (\frac {\sqrt {-c+d x}}{\sqrt {c+d x}}\right )}{48 d^5} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [C] Result contains higher order function than in optimal. Order 9 vs. order
3.
time = 0.29, size = 240, normalized size = 1.51
method | result | size |
risch | \(\frac {x \left (-8 b \,d^{4} x^{4}-12 a \,d^{4} x^{2}+2 b \,c^{2} d^{2} x^{2}+6 a \,c^{2} d^{2}+3 b \,c^{4}\right ) \left (-d x +c \right ) \sqrt {d x +c}}{48 d^{4} \sqrt {d x -c}}-\frac {\left (\frac {c^{4} \ln \left (\frac {d^{2} x}{\sqrt {d^{2}}}+\sqrt {d^{2} x^{2}-c^{2}}\right ) a}{8 d^{2} \sqrt {d^{2}}}+\frac {c^{6} \ln \left (\frac {d^{2} x}{\sqrt {d^{2}}}+\sqrt {d^{2} x^{2}-c^{2}}\right ) b}{16 d^{4} \sqrt {d^{2}}}\right ) \sqrt {\left (d x -c \right ) \left (d x +c \right )}}{\sqrt {d x -c}\, \sqrt {d x +c}}\) | \(192\) |
default | \(-\frac {\sqrt {d x -c}\, \sqrt {d x +c}\, \left (-8 \,\mathrm {csgn}\left (d \right ) b \,d^{5} x^{5} \sqrt {d^{2} x^{2}-c^{2}}-12 \,\mathrm {csgn}\left (d \right ) a \,d^{5} x^{3} \sqrt {d^{2} x^{2}-c^{2}}+2 \,\mathrm {csgn}\left (d \right ) b \,c^{2} d^{3} x^{3} \sqrt {d^{2} x^{2}-c^{2}}+6 \sqrt {d^{2} x^{2}-c^{2}}\, \mathrm {csgn}\left (d \right ) d^{3} a \,c^{2} x +3 \sqrt {d^{2} x^{2}-c^{2}}\, \mathrm {csgn}\left (d \right ) d b \,c^{4} x +6 \ln \left (\left (\sqrt {d^{2} x^{2}-c^{2}}\, \mathrm {csgn}\left (d \right )+d x \right ) \mathrm {csgn}\left (d \right )\right ) a \,c^{4} d^{2}+3 \ln \left (\left (\sqrt {d^{2} x^{2}-c^{2}}\, \mathrm {csgn}\left (d \right )+d x \right ) \mathrm {csgn}\left (d \right )\right ) b \,c^{6}\right ) \mathrm {csgn}\left (d \right )}{48 \sqrt {d^{2} x^{2}-c^{2}}\, d^{5}}\) | \(240\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.27, size = 192, normalized size = 1.21 \begin {gather*} \frac {{\left (d^{2} x^{2} - c^{2}\right )}^{\frac {3}{2}} b x^{3}}{6 \, d^{2}} - \frac {b c^{6} \log \left (2 \, d^{2} x + 2 \, \sqrt {d^{2} x^{2} - c^{2}} d\right )}{16 \, d^{5}} - \frac {a c^{4} \log \left (2 \, d^{2} x + 2 \, \sqrt {d^{2} x^{2} - c^{2}} d\right )}{8 \, d^{3}} + \frac {\sqrt {d^{2} x^{2} - c^{2}} b c^{4} x}{16 \, d^{4}} + \frac {\sqrt {d^{2} x^{2} - c^{2}} a c^{2} x}{8 \, d^{2}} + \frac {{\left (d^{2} x^{2} - c^{2}\right )}^{\frac {3}{2}} b c^{2} x}{8 \, d^{4}} + \frac {{\left (d^{2} x^{2} - c^{2}\right )}^{\frac {3}{2}} a x}{4 \, d^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 3.44, size = 112, normalized size = 0.70 \begin {gather*} \frac {{\left (8 \, b d^{5} x^{5} - 2 \, {\left (b c^{2} d^{3} - 6 \, a d^{5}\right )} x^{3} - 3 \, {\left (b c^{4} d + 2 \, a c^{2} d^{3}\right )} x\right )} \sqrt {d x + c} \sqrt {d x - c} + 3 \, {\left (b c^{6} + 2 \, a c^{4} d^{2}\right )} \log \left (-d x + \sqrt {d x + c} \sqrt {d x - c}\right )}{48 \, d^{5}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int x^{2} \left (a + b x^{2}\right ) \sqrt {- c + d x} \sqrt {c + d x}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 432 vs.
\(2 (135) = 270\).
time = 0.63, size = 432, normalized size = 2.72 \begin {gather*} \frac {40 \, {\left (\sqrt {d x + c} \sqrt {d x - c} {\left ({\left (d x + c\right )} {\left (\frac {2 \, {\left (d x + c\right )}}{d^{2}} - \frac {7 \, c}{d^{2}}\right )} + \frac {9 \, c^{2}}{d^{2}}\right )} + \frac {6 \, c^{3} \log \left ({\left | -\sqrt {d x + c} + \sqrt {d x - c} \right |}\right )}{d^{2}}\right )} a c + 2 \, {\left ({\left ({\left (2 \, {\left (d x + c\right )} {\left (3 \, {\left (d x + c\right )} {\left (\frac {4 \, {\left (d x + c\right )}}{d^{4}} - \frac {21 \, c}{d^{4}}\right )} + \frac {133 \, c^{2}}{d^{4}}\right )} - \frac {295 \, c^{3}}{d^{4}}\right )} {\left (d x + c\right )} + \frac {195 \, c^{4}}{d^{4}}\right )} \sqrt {d x + c} \sqrt {d x - c} + \frac {90 \, c^{5} \log \left ({\left | -\sqrt {d x + c} + \sqrt {d x - c} \right |}\right )}{d^{4}}\right )} b c + 10 \, {\left ({\left ({\left (d x + c\right )} {\left (2 \, {\left (d x + c\right )} {\left (\frac {3 \, {\left (d x + c\right )}}{d^{3}} - \frac {13 \, c}{d^{3}}\right )} + \frac {43 \, c^{2}}{d^{3}}\right )} - \frac {39 \, c^{3}}{d^{3}}\right )} \sqrt {d x + c} \sqrt {d x - c} - \frac {18 \, c^{4} \log \left ({\left | -\sqrt {d x + c} + \sqrt {d x - c} \right |}\right )}{d^{3}}\right )} a d + {\left ({\left ({\left (2 \, {\left ({\left (d x + c\right )} {\left (4 \, {\left (d x + c\right )} {\left (\frac {5 \, {\left (d x + c\right )}}{d^{5}} - \frac {31 \, c}{d^{5}}\right )} + \frac {321 \, c^{2}}{d^{5}}\right )} - \frac {451 \, c^{3}}{d^{5}}\right )} {\left (d x + c\right )} + \frac {745 \, c^{4}}{d^{5}}\right )} {\left (d x + c\right )} - \frac {405 \, c^{5}}{d^{5}}\right )} \sqrt {d x + c} \sqrt {d x - c} - \frac {150 \, c^{6} \log \left ({\left | -\sqrt {d x + c} + \sqrt {d x - c} \right |}\right )}{d^{5}}\right )} b d}{240 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 42.57, size = 1681, normalized size = 10.57 \begin {gather*} \frac {\frac {35\,b\,c^6\,{\left (\sqrt {c+d\,x}-\sqrt {c}\right )}^3}{12\,{\left (\sqrt {-c}-\sqrt {d\,x-c}\right )}^3}-\frac {b\,c^6\,\left (\sqrt {c+d\,x}-\sqrt {c}\right )}{4\,\left (\sqrt {-c}-\sqrt {d\,x-c}\right )}+\frac {757\,b\,c^6\,{\left (\sqrt {c+d\,x}-\sqrt {c}\right )}^5}{4\,{\left (\sqrt {-c}-\sqrt {d\,x-c}\right )}^5}+\frac {7339\,b\,c^6\,{\left (\sqrt {c+d\,x}-\sqrt {c}\right )}^7}{4\,{\left (\sqrt {-c}-\sqrt {d\,x-c}\right )}^7}+\frac {41929\,b\,c^6\,{\left (\sqrt {c+d\,x}-\sqrt {c}\right )}^9}{6\,{\left (\sqrt {-c}-\sqrt {d\,x-c}\right )}^9}+\frac {25661\,b\,c^6\,{\left (\sqrt {c+d\,x}-\sqrt {c}\right )}^{11}}{2\,{\left (\sqrt {-c}-\sqrt {d\,x-c}\right )}^{11}}+\frac {25661\,b\,c^6\,{\left (\sqrt {c+d\,x}-\sqrt {c}\right )}^{13}}{2\,{\left (\sqrt {-c}-\sqrt {d\,x-c}\right )}^{13}}+\frac {41929\,b\,c^6\,{\left (\sqrt {c+d\,x}-\sqrt {c}\right )}^{15}}{6\,{\left (\sqrt {-c}-\sqrt {d\,x-c}\right )}^{15}}+\frac {7339\,b\,c^6\,{\left (\sqrt {c+d\,x}-\sqrt {c}\right )}^{17}}{4\,{\left (\sqrt {-c}-\sqrt {d\,x-c}\right )}^{17}}+\frac {757\,b\,c^6\,{\left (\sqrt {c+d\,x}-\sqrt {c}\right )}^{19}}{4\,{\left (\sqrt {-c}-\sqrt {d\,x-c}\right )}^{19}}+\frac {35\,b\,c^6\,{\left (\sqrt {c+d\,x}-\sqrt {c}\right )}^{21}}{12\,{\left (\sqrt {-c}-\sqrt {d\,x-c}\right )}^{21}}-\frac {b\,c^6\,{\left (\sqrt {c+d\,x}-\sqrt {c}\right )}^{23}}{4\,{\left (\sqrt {-c}-\sqrt {d\,x-c}\right )}^{23}}}{d^5-\frac {12\,d^5\,{\left (\sqrt {c+d\,x}-\sqrt {c}\right )}^2}{{\left (\sqrt {-c}-\sqrt {d\,x-c}\right )}^2}+\frac {66\,d^5\,{\left (\sqrt {c+d\,x}-\sqrt {c}\right )}^4}{{\left (\sqrt {-c}-\sqrt {d\,x-c}\right )}^4}-\frac {220\,d^5\,{\left (\sqrt {c+d\,x}-\sqrt {c}\right )}^6}{{\left (\sqrt {-c}-\sqrt {d\,x-c}\right )}^6}+\frac {495\,d^5\,{\left (\sqrt {c+d\,x}-\sqrt {c}\right )}^8}{{\left (\sqrt {-c}-\sqrt {d\,x-c}\right )}^8}-\frac {792\,d^5\,{\left (\sqrt {c+d\,x}-\sqrt {c}\right )}^{10}}{{\left (\sqrt {-c}-\sqrt {d\,x-c}\right )}^{10}}+\frac {924\,d^5\,{\left (\sqrt {c+d\,x}-\sqrt {c}\right )}^{12}}{{\left (\sqrt {-c}-\sqrt {d\,x-c}\right )}^{12}}-\frac {792\,d^5\,{\left (\sqrt {c+d\,x}-\sqrt {c}\right )}^{14}}{{\left (\sqrt {-c}-\sqrt {d\,x-c}\right )}^{14}}+\frac {495\,d^5\,{\left (\sqrt {c+d\,x}-\sqrt {c}\right )}^{16}}{{\left (\sqrt {-c}-\sqrt {d\,x-c}\right )}^{16}}-\frac {220\,d^5\,{\left (\sqrt {c+d\,x}-\sqrt {c}\right )}^{18}}{{\left (\sqrt {-c}-\sqrt {d\,x-c}\right )}^{18}}+\frac {66\,d^5\,{\left (\sqrt {c+d\,x}-\sqrt {c}\right )}^{20}}{{\left (\sqrt {-c}-\sqrt {d\,x-c}\right )}^{20}}-\frac {12\,d^5\,{\left (\sqrt {c+d\,x}-\sqrt {c}\right )}^{22}}{{\left (\sqrt {-c}-\sqrt {d\,x-c}\right )}^{22}}+\frac {d^5\,{\left (\sqrt {c+d\,x}-\sqrt {c}\right )}^{24}}{{\left (\sqrt {-c}-\sqrt {d\,x-c}\right )}^{24}}}-\frac {\frac {a\,c^4\,\left (\sqrt {c+d\,x}-\sqrt {c}\right )}{2\,\left (\sqrt {-c}-\sqrt {d\,x-c}\right )}+\frac {35\,a\,c^4\,{\left (\sqrt {c+d\,x}-\sqrt {c}\right )}^3}{2\,{\left (\sqrt {-c}-\sqrt {d\,x-c}\right )}^3}+\frac {273\,a\,c^4\,{\left (\sqrt {c+d\,x}-\sqrt {c}\right )}^5}{2\,{\left (\sqrt {-c}-\sqrt {d\,x-c}\right )}^5}+\frac {715\,a\,c^4\,{\left (\sqrt {c+d\,x}-\sqrt {c}\right )}^7}{2\,{\left (\sqrt {-c}-\sqrt {d\,x-c}\right )}^7}+\frac {715\,a\,c^4\,{\left (\sqrt {c+d\,x}-\sqrt {c}\right )}^9}{2\,{\left (\sqrt {-c}-\sqrt {d\,x-c}\right )}^9}+\frac {273\,a\,c^4\,{\left (\sqrt {c+d\,x}-\sqrt {c}\right )}^{11}}{2\,{\left (\sqrt {-c}-\sqrt {d\,x-c}\right )}^{11}}+\frac {35\,a\,c^4\,{\left (\sqrt {c+d\,x}-\sqrt {c}\right )}^{13}}{2\,{\left (\sqrt {-c}-\sqrt {d\,x-c}\right )}^{13}}+\frac {a\,c^4\,{\left (\sqrt {c+d\,x}-\sqrt {c}\right )}^{15}}{2\,{\left (\sqrt {-c}-\sqrt {d\,x-c}\right )}^{15}}}{d^3-\frac {8\,d^3\,{\left (\sqrt {c+d\,x}-\sqrt {c}\right )}^2}{{\left (\sqrt {-c}-\sqrt {d\,x-c}\right )}^2}+\frac {28\,d^3\,{\left (\sqrt {c+d\,x}-\sqrt {c}\right )}^4}{{\left (\sqrt {-c}-\sqrt {d\,x-c}\right )}^4}-\frac {56\,d^3\,{\left (\sqrt {c+d\,x}-\sqrt {c}\right )}^6}{{\left (\sqrt {-c}-\sqrt {d\,x-c}\right )}^6}+\frac {70\,d^3\,{\left (\sqrt {c+d\,x}-\sqrt {c}\right )}^8}{{\left (\sqrt {-c}-\sqrt {d\,x-c}\right )}^8}-\frac {56\,d^3\,{\left (\sqrt {c+d\,x}-\sqrt {c}\right )}^{10}}{{\left (\sqrt {-c}-\sqrt {d\,x-c}\right )}^{10}}+\frac {28\,d^3\,{\left (\sqrt {c+d\,x}-\sqrt {c}\right )}^{12}}{{\left (\sqrt {-c}-\sqrt {d\,x-c}\right )}^{12}}-\frac {8\,d^3\,{\left (\sqrt {c+d\,x}-\sqrt {c}\right )}^{14}}{{\left (\sqrt {-c}-\sqrt {d\,x-c}\right )}^{14}}+\frac {d^3\,{\left (\sqrt {c+d\,x}-\sqrt {c}\right )}^{16}}{{\left (\sqrt {-c}-\sqrt {d\,x-c}\right )}^{16}}}+\frac {a\,c^4\,\mathrm {atanh}\left (\frac {\sqrt {c+d\,x}-\sqrt {c}}{\sqrt {-c}-\sqrt {d\,x-c}}\right )}{2\,d^3}+\frac {b\,c^6\,\mathrm {atanh}\left (\frac {\sqrt {c+d\,x}-\sqrt {c}}{\sqrt {-c}-\sqrt {d\,x-c}}\right )}{4\,d^5} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________